<include file="Common:header"/>
<link rel="stylesheet" href="__PUBLIC__/css/article.css">
<body style="position:relative;margin-left: auto;margin-right: auto;" >
<style>
.subbtn1988{
	margin-top:10px
}
.subbtn1999{
	margin-top:10px
}
.center5585{
	display:block;
	width:94%
}
.center5581{
	width:95%
}
.jiantou{
	left:7px
}
.centerol{
	margin:4px
}
.hh{
	height:44px
}
.c8{
	background-color:#3cd09a
}
.centerol{
	width:28%
}
.centerol{
		margin:3px
}
.bottom_cen{
	margin-top:10px;
	margin-bottom:5px
}
.center5581{
	border:3px solid #ff5876;
}
.center5585{
	background-color:#ffffff
}
.edit_con .btn_area .banner_sub{
		border-radius: 4px;
		background-color: #f00;
		color: #fff;
		width: 100px;
		height: 40px;
		vertical-align: center;
		display: inline-block;
		margin-left:15px;
		margin-top:20px
	}
	.edit_con .banner_word .write_area{
		border: 2px solid #cccccc;
		margin: 5px 0 0 0;
		width: 93%;
		height: 30px;
		margin-left:14px;
		line-height: 30px;
		text-indent: 1em;
	
	}
	#banner{
		z-index:5
	}
	#mymodal {
		position: absolute;
		width: 100%;
		height: 100%;
		background-color: #ffffff;
		top: 0px;
		z-index: 5;
		overflow-y: scroll;
		left:3px
	}
	#stxt div{
		font-size:inherit
	}
	
</style>
<div class="kkfoot2" style="position:fixed;top:0px;right:0px;">
	<include file="Common:success_bottom"/>
	<!-- <button  id="success" onclick="display_title()" class="subbtn1988" value="完成" style="text-align:center"></button>
	<button class="subbtn1999" value="取消" style="text-align:center" onclick="go_back()"></button>		 -->
	</div>
	<div id="page" style="margin-top:50px">
	<div id="toolbar"></div>
	<div class="txt1 xn c4 pa20 h3" id="tips" onclick="tedit_body(this)">提示：点击任何文字开始编辑</div>
	<div id="main">
		<!-- onclick="" 不能删除，他是兼容苹果手机点击触发不了编辑器问题 -->
		<div id="middle_content" style="margin-top:0px" onclick="" class="tedit_body">
			<!-- 音乐播放 -->
			<audio loop="" src="" id="media_tym" autoplay="" preload=""></audio>
		   <div id="content"></div>
		</div>
		<input type="hidden" id="form_music" name="music" value="">
		<include file="Common:menu_edit_list"/>
		<script src="__PUBLIC__/js/xxUploadImgTemplate.js"></script>
		<include file="Common:display_title"/>	
	</div>
	<div class="n5 cb"></div>
</div>
</body> 
</html>
<script>	

	//显示标题
	function success_show(){
		$('#banner').show();
		return false;
	}


	//异步提交
	function success(){
		
		var title   = $('#new_title').val();
		var content = $('#middle_content').html();
		var new_content = $('#content').nextAll().length;
		var music_id = $('#form_music').val();
		var new_title = $('#new_title').val();
		var share_introduction = $('#share_introduction').val();	//分享图片
		var upload = $('#upload').val();		//分享图片
		
		if($(".tedit_body *").hasClass('eing')){
			layer.open({
				content:'请取消编辑器在保存'
			});
			return false;
		}
		
		//标题
		if(new_title == ''){
			$('#banner').show();
			layer.open({
				content:'请先添加文章标题'
			});
			return false;
		}
		
		
		//内容
		if(new_content <= 0){
			layer.open({
				content:'请先添加内容'
			});
			return false;
		}
		
		$.ajax({
		   type: "POST",
		   url: "<{:U('Home/Article/article_submit')}>",
		   data: "content="+content+"&title="+title+"&type=1"+"&music_id="+music_id+"&share_introduction="+share_introduction+"&upload="+upload,
		   success: function(msg){
			 if(msg.status == '1'){
                 layer.open({
                    content:msg.msg,
                    btn: ['确认'],
                    yes:function(){
                       window.location.href = msg.url;
                    }
                });
			 }else{
				 layer.open({
					content:msg.msg
				 });
			 }
		   }
		});
	}	
</script>
